package com.gzx.plugin.website.user.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gzx.plugin.website.user.entity.bo.GzxWebsiteUserLogQueryBo;
import com.gzx.plugin.website.user.entity.vo.GzxWebsiteUserLogVo;
import com.gzx.plugin.website.user.service.GzxWebsiteUserLogService;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.common.annotation.CommonLog;
import vip.xiaonuo.common.pojo.CommonResult;

import java.io.IOException;

/**
 * @author zjt
 * @description
 * @date 2025/1/8 17:40
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/website/user/log")
public class GzxWebsiteUserLogController {

    private final GzxWebsiteUserLogService websiteUserLogService;

    /**
     * 根据甲方系统主键获取案件详情
     */
    @PostMapping("/pageList")
    public CommonResult<Page<GzxWebsiteUserLogVo>> pageList(@RequestBody GzxWebsiteUserLogQueryBo queryBo) {
        return CommonResult.data(websiteUserLogService.pageList(queryBo));
    }

    /**
     * 根据甲方系统主键获取案件详情
     */
    @PostMapping("/export")
    @CommonLog("官网后台数据导出")
    public void export(@RequestBody GzxWebsiteUserLogQueryBo queryBo, HttpServletResponse response) throws IOException {
        websiteUserLogService.export(queryBo, response);
    }
}
